﻿<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>formvalidator.js" charset="UTF-8"></script>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>formvalidatorregex.js" charset="UTF-8"></script>
<script type="text/javascript">
<!--
$(function(){
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#defualtpoint").formValidator({tipid:"pointtip",onshow:"<?php echo L('input').L('defualtpoint')?>",onfocus:"<?php echo L('defualtpoint').L('between_1_to_8_num')?>"}).regexValidator({regexp:"^\\d{1,8}$",onerror:"<?php echo L('defualtpoint').L('between_1_to_8_num')?>"});
	$("#defualtamount").formValidator({tipid:"starnumtip",onshow:"<?php echo L('input').L('defualtamount')?>",onfocus:"<?php echo L('defualtamount').L('between_1_to_8_num')?>"}).regexValidator({regexp:"^\\d{1,8}$",onerror:"<?php echo L('defualtamount').L('between_1_to_8_num')?>"});
	$("#rmb_point_rate").formValidator({tipid:"rmb_point_rateid",onshow:"<?php echo L('input').L('rmb_point_rate')?>",onfocus:"<?php echo L('rmb_point_rate').L('between_1_to_8_num')?>"}).regexValidator({regexp:"^\\d{1,8}$",onerror:"<?php echo L('rmb_point_rate').L('between_1_to_8_num')?>"});

});
//-->
</script>


<div class="pad-lr-10">
<div class="common-form">
<form name="myform" action="<?php echo U('setting'); ?>" method="post" id="myform">
	<table width="100%" class="table_form">
		<tr>
			<td width="200">会员币种配置</td> 
			<td>
				<label><input type="text" size="6" name="info[type_config]" value="<?php echo $member_setting['type_config'] ?>">币</label>
			</td>
		</tr>
		<tr>
			<td width="200"><?php echo L('allow_register')?></td> 
			<td>
				<label><input type="radio" name="info[allowregister]"  class="input-radio" <?php if($member_setting['allowregister']) {?>checked<?php }?> value='1'><?php echo L('yes')?> </label>&nbsp;<label><input type="radio" name="info[allowregister]"  class="input-radio" <?php if(!$member_setting['allowregister']) {?>checked<?php }?> value='0'><?php echo L('no')?></label>
			</td>
		</tr>
		
		<tr>
			<td width="200"><?php echo L('register_model')?></td> 
			<td>
				<label><input type="radio" name="info[choosemodel]"  class="input-radio"<?php if($member_setting['choosemodel']) {?>checked<?php }?> value='1'><?php echo L('yes')?></label>&nbsp;
				<label><input type="radio" name="info[choosemodel]"  class="input-radio"<?php if(!$member_setting['choosemodel']) {?>checked<?php }?> value='0'><?php echo L('no')?></label>
			</td>
		</tr>
		
		<tr>
			<td width="200">需要邮件审核会员</td> 
			<td>
				<?php foreach ($models as $key => $v): ?>
					<label><input type="checkbox" name="info[emailcheck_model][]" value="<?php echo $key ?>" <?php echo (in_array($key, $member_setting['emailcheck_model'])) ? 'checked' : ''; ?>> <?php echo $v['name'] ?></label>&nbsp;
				<?php endforeach; ?>
				&nbsp;&nbsp;<font color=red><?php echo L('enablemailcheck_notice')?></font>
			</td>
		</tr>

		<tr>
			<td width="200">需要管理员审核会员</td> 
			<td>
				<?php foreach ($models as $key => $v): ?>
					<label><input type="checkbox" name="info[admincheck_model][]" value="<?php echo $key ?>"> <?php echo $v['name'] ?></label>&nbsp;
				<?php endforeach; ?>
			</td>
		</tr>

		<tr>
			<td width="200">注册默认会员组</td> 
			<td>
			<?php echo $form::select($grouplist, $member_setting['register_groupid'], 'name="info[register_groupid]"', L('member_group'))?>
			</td>
		</tr>

		<tr>
			<td width="200"><?php echo L('enablcodecheck')?></td> 
			<td>
				<label><input type="radio" name="info[enablcodecheck]"  class="input-radio"<?php if($member_setting['enablcodecheck']) {?>checked<?php }?> value='1'><?php echo L('yes')?></label>&nbsp;
				<label><input type="radio" name="info[enablcodecheck]"  class="input-radio"<?php if(!$member_setting['enablcodecheck']) {?>checked<?php }?> value='0'><?php echo L('no')?></label>
			</td>
		</tr>
		
		<tr>
			<td width="200"><?php echo L('rmb_point_rate')?></td> 
			<td>
				<input type="text" name="info[rmb_point_rate]" id="rmb_point_rate" class="input-text" size="4" value="<?php echo $member_setting['rmb_point_rate'];?>">
			</td>
		</tr>
				
		<tr>
			<td width="200"><?php echo L('defualtpoint')?></td> 
			<td>
				<input type="text" name="info[defualtpoint]" id="defualtpoint" class="input-text" size="4" value="<?php echo $member_setting['defualtpoint'];?>">
			</td>
		</tr>

		<tr>
			<td width="200"><?php echo L('show_register_protocol')?></td> 
			<td>
				<?php echo L('yes')?><input type="radio" name="info[showregprotocol]"  class="input-radio" <?php if($member_setting['showregprotocol']) {?>checked<?php }?> value='1'>
				<?php echo L('no')?><input type="radio" name="info[showregprotocol]"  class="input-radio" <?php if(!$member_setting['showregprotocol']) {?>checked<?php }?> value='0'>
			</td>
		</tr>
		
		<tr>
			<td width="200"><?php echo L('register_verify_message')?></td> 
			<td>
				<textarea name="info[registerverifymessage]" id="registerverifymessage" style="width:80%;height:120px;"><?php echo  $member_setting['registerverifymessage'];?></textarea>
				<BR><?php echo L('register_func_tips');?>

			</td>
		</tr>
		<tr>
			<td width="200"><?php echo L('forgetpasswordmessage')?></td> 
			<td>
				<textarea name="info[forgetpassword]" id="forgetpassword" style="width:80%;height:120px;"><?php echo $member_setting['forgetpassword']; ?></textarea>
			</td>
		</tr>
		<tr>
			<td width="200">提现配置</td> 
			<td>
				(支付宝)最低提现金额  <input type="text" name="info[alipay]" id="defualtpoint" class="input-text" size="6" value="<?php echo $member_setting['alipay'];?>">元
				&nbsp;&nbsp;(财付通)最低提现金额 <input type="text" name="info[tenpay]" id="defualtpoint" class="input-text" size="6" value="<?php echo $member_setting['tenpay'];?>">元
				&nbsp;&nbsp;(银行)最低提现金额 <input type="text" name="info[bank]" id="defualtpoint" class="input-text" size="6" value="<?php echo $member_setting['bank'];?>">元
				
				
			</td>
		</tr>
		<tr>
			<td width="200">注册成功获得U币配置</td> 
			<td>
				<input type="text" name="info[reg_coin]" id="defualtpoint" class="input-text" size="6" value="<?php echo $member_setting['reg_coin'];?>">个U币
			</td>
		</tr>
		<tr>
			<td width="200">U币兑换金额配置</td> 
			<td>1元等价于
				<input type="text" name="info[u_coin]" id="defualtpoint" class="input-text" size="6" value="<?php echo $member_setting['u_coin'];?>">个U币
				<div class="onShow">如10000个u币可以提现1元，20000个U币可以提现2元</div>
			</td>
		</tr>
		<tr>
			<td width="200">兑换配置</td> 
			<td>1个U币可兑换
				<input type="text" name="info[exc_bean]" id="defualtpoint" class="input-text" size="6" value="<?php echo $member_setting['exc_bean'];?>">个U豆
				<div class="onShow">如1个U币可以兑换10个U豆（1*10）</div>
				
			</td>
		</tr>
		<?php $autoindex = 1; ?>
		<?php foreach ($member_setting['cash_config'] as $key => $value): ?>
		<tr class="item_tr" id="item_<?php echo $autoindex;?>">
			<td width="200">奖励配置</td>			
			<td>
				当提现大于等于<input type="text" size='6' name="info[cash_config][money][]" value="<?php echo $key;?>"/>元时，奖励
				一级
				<input type="text" name="info[cash_config][number][<?php echo $autoindex ?>][1]" value="<?php echo $value['1']; ?>" size="10">
				二级
				<input type="text" name="info[cash_config][number][<?php echo $autoindex ?>][2]" value="<?php echo $value['2']; ?>" size="10">
				三级
				<input type="text" name="info[cash_config][number][<?php echo $autoindex ?>][3]" value="<?php echo $value['3']; ?>" size="10">
				四级
				<input type="text" name="info[cash_config][number][<?php echo $autoindex ?>][4]" value="<?php echo $value['4']; ?>" size="10">
				<a class="del" data-id="<?php echo $autoindex; ?>" href="javascript:;">移除</a>
			</td>
		</tr>
		<?php $autoindex++; ?>
		<?php endforeach ?>	
		
	<tr>
		<td><a id="additem" href="javascript:;">【增加条目】</a></td>
	</tr>
	</table>
    <div class="bk15"></div>
    <input name="dosubmit" type="submit" id="dosubmit" value="<?php echo L('submit')?>" class="button">
</form>
</div>
</div>
<script type="text/javascript">
$("#additem").click(function(){
	var autoindex = $("tr.item_tr").size() + 1 ;
	var _html= '';
	_html += '<tr class="item_tr" id="item_'+autoindex+'">';
	_html += '<td width="200">奖励配置</td>	';	
	_html += '<td>';
	_html += '当提现大于等于<input type="text" name="info[cash_config][money][]"  size="6" class="input-text" />元时，奖励';
	_html += '&nbsp;一级&nbsp;';
	_html += '<input type="text" name="info[cash_config][number]['+autoindex+'][1]" class="input-text" size="10">';
	_html += '&nbsp;二级&nbsp;';
	_html += '<input type="text" name="info[cash_config][number]['+autoindex+'][2]" class="input-text" size="10">';
	_html += '&nbsp;三级&nbsp;';
	_html += '<input type="text" name="info[cash_config][number]['+autoindex+'][3]" class="input-text" size="10">';
	_html += '&nbsp;四级&nbsp;';
	_html += '<input type="text" name="info[cash_config][number]['+autoindex+'][4]" class="input-text" size="10"><a class="del" data-id='+autoindex+' href="javascript:;">&nbsp;移除</a>';
	_html += '</td>';	
	_html += '</tr>';
	var item = autoindex - 1;
	$(this).parent().parent().before(_html);
	
});
$(".del").click(function(){
	var item=$(this).data('id');
	$("#item_" + item).remove();
});
</script>

<script>


</script>
</body>
</html>
